package com.tnsw.noxnox.signin;

import android.R;
import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;

public class SigninAdapter extends BaseAdapter implements OnCheckedChangeListener {

	private String tag = "SigninAdapter";
	private Context mContext;
	private LayoutInflater inflater;
	
	private NXViewSwitcher nx;
	
	public SigninAdapter(Context context) {
		this.mContext = context;
		Log.d(tag, "Constructor()");
		this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	
	}
	
	@Override
	public int getCount() {
		return 1;
	}

	@Override
	public Object getItem(int position) {
		return (this.nx);
	}

	@Override
	public long getItemId(int position) {
		return(position);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {		
		View vi = convertView;
		Log.d(tag, "getView()");
		if (vi == null) {
			
			vi = this.inflater.inflate(com.tnsw.noxnox.R.layout.base_switcher, null);
			//vi = new NXViewSwitcher(this.mContext);
			this.nx = new NXViewSwitcher(this.mContext, vi);
			this.nx.setOnCheckedChangeListener(this);
			
			this.nx.test();
			Log.d(tag, "inflate");
		}
		return(vi);
	}

	@Override
	public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
		Log.d(tag, "onCheckedChanged()");
		
	}

}
